package org.jadapter.tests;

import static org.junit.Assert.assertEquals;

import java.util.HashMap;
import java.util.Map;

import org.jadapter.registry.AdapterRegistry;
import org.jadapter.registry.TransientAdapterRegistry;
import org.jadapter.tests.examples.ConstructorAdapter;
import org.jadapter.tests.examples.Csv;
import org.junit.Test;

public class TestTransientRegistry {
	
	@Test
	public void baseCase(){
		
		AdapterRegistry registry = new TransientAdapterRegistry();
		
		registry.register(ConstructorAdapter.class, Csv.class, Map.class);
		Map map = new HashMap();
		map.put("Foo", "bar");
		
		Csv csv = registry.transform(map, Csv.class);
		
		assertEquals("Foo:bar", csv.csv());
		
	}

}
